import request from '@/utils/request'

// 获取患者的处方列表
export const DocterGetPaientPreList = (obj) => {
  return request({
    url: '/prescription/all',
    method: 'get',
    params: obj
  })
}

// 创建处方
export const DocterCreateNewPre = (obj) => {
  return request({
    url: '/prescription/create',
    method: 'post',
    data: obj
  })
}

// 修改处方
export const DocterUpdatePre = (obj) => {
  return request({
    url: '/prescription/change',
    method: 'post',
    data: obj
  })
}

// 准备搜索框药品获取药表
export const DocterGetAllDrug = () => {
  return request({
    url: '/medicine/all',
    method: 'get'
  })
}

// 创建药方
export const DocterCreateNewDrug = (obj) => {
  return request({
    url: '/medicine_use/create',
    method: 'post',
    data: obj
  })
}

// 修改药方
export const DocterUpdateDrug = (obj) => {
  return request({
    url: '/medicine_use/change',
    method: 'post',
    data: obj
  })
}

// 获取处方的所有药品
export const DocterGetAllDrugByPre = (obj) => {
  return request({
    url: '/medicine_use/all',
    method: 'get',
    params: obj
  })
}

// 删药
export const DocterDeleteDrug = (obj) => {
  return request({
    url: '/medicine_use/delete',
    method: 'post',
    data: obj
  })
}

// 完成处方
export const DocterFinishPre = (obj) => {
  return request({
    url: '/prescription/done',
    method: 'post',
    data: obj
  })
}
